package com.tcs.test.designmodel.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JdkHardle implements InvocationHandler {

	private final Logger logger = LoggerFactory.getLogger(JdkHardle.class);
	
	private Object obj;
	
	public JdkHardle() {super();};
	
	public JdkHardle(Object obj) {
		super();
		this.obj = obj;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		logger.info(" 开始之前 ");
		Object result = method.invoke(obj, args);
		logger.info(" 开始之后 ");
		return result;
	}

}
